# -*- coding:utf-8 -*-
"""
Created on 19 Feb 2010

@author: iliask
"""
import logging
class Debug():
    def __init__(self,formatString="%(asctime)s - %(name)s - %(levelname)s - %(message)s",level=logging.DEBUG):
        self.logger = logging.getLogger("Parser")
        self.logger.setLevel(level)
        self.ch = logging.StreamHandler()
        self.ch.setLevel(level)
        self.formatter = logging.Formatter(formatString)
        self.ch.setFormatter(self.formatter)
        self.logger.addHandler(self.ch)
        self.loggedMessages=0
    def INFO(self,msg):
        self.logger.log(logging.INFO,msg)
        self.loggedMessages+=1
    def DEBUG(self,msg):
        self.logger.log(logging.DEBUG,msg)
        self.loggedMessages+=1
    def CRITICAL(self,msg):
        self.logger.log(logging.CRITICAL,msg)
        self.loggedMessages+=1
    def ERROR(self,msg):
        self.logger.log(logging.ERROR,msg)
        self.loggedMessages+=1
    def FATAL(self,msg):
        self.logger.log(logging.FATAL,msg)
        self.loggedMessages+=1
    def WARNING(self,msg):
        self.logger.log(logging.WARNING,msg)
        self.loggedMessages+=1
if __name__=='__main__':
    d=Debug()
    d.INFO('test')